Repository navigation
fix: migrate poke-token-bar to structured postflight steps - #2
Conversation
Replace the legacy hook and system_command with postflight_steps and run. Expand the application directory at install time with the appdir token. Preserve xattr arguments, unprivileged execution and failure handling.
|
I verified this locally on Homebrew 7.0.7 using a throwaway local tap:
It also works with the release automation. LGTM from a downstream user. It fixes chattymin/PokeTokenBar#385. |
|
Still seeing the |
|
@chattymin Friendly ping — is there anything you’d like me to adjust before this can be merged? Thanks! |
|
Thank you for making this update and for the follow-up notification. I wasn't aware that Homebrew had deprecated the old |
Summary
Homebrew prints a deprecation warning whenever it loads the
poke-token-barcask. Migrate its post-install hook to the structuredpostflight_stepsDSL, usingrunand the deferred{{appdir}}token so the existing/usr/bin/xattr -crcommand targets the configured application directory at installation time.The command arguments, unprivileged execution and failure handling are preserved. Also remove an extra blank line and add the missing final newline flagged by
brew style.Related to #1: renaming the stanza alone fails to load on Homebrew 7.0.1-15-g82ea9cb with
undefined local variable or method 'appdir' for an instance of Homebrew::InstallSteps::DSL. The block also needsrunin place of the legacysystem_commandhelper.Reference: Homebrew's structured flight steps and interpolation documentation.
Validation
Cask::CaskLoader::FromContentLoader: no deprecation warning./usr/bin/xattr,-cr, default/Applicationsand a custom application directory containing a space,sudo: false, and fail-on-error behavior. No application installation or realxattrcommand was performed.brew style Casks/poke-token-bar.rb: the install-step offense is resolved; two pre-existing offenses remain (Homebrew/OSDependsOnandCask/ArrayAlphabetization). The original cask has five offenses; this patch introduces none.git diff --check: passed.